package com.wander.patterns.create.builder;

/**
 * @description:具体的指挥者 组装需要的对象
 * @author: zhuyong
 * @create: 2019-09-06 16:04
 **/
public class MyAirShipDirector implements AirShipDirector {

    AirShipBuilder airShipBuilder;

    public MyAirShipDirector(AirShipBuilder airShipBuilder) {
        this.airShipBuilder = airShipBuilder;
    }

    @Override
    public AirShip createAirShop() {
        //
        AirShip airShip = new AirShip();

        airShip.setEngine(airShipBuilder.buildEngine());

        airShip.setOrbitalModel(airShipBuilder.builderOrbitalModel());

        airShip.setEscapeTower(airShipBuilder.builderEscapeTower());

        return airShip;
    }
}
